﻿#ifndef UIMODBUSMAPINFO_H
#define UIMODBUSMAPINFO_H

#include <QWidget>
#include <QVBoxLayout>
#include <QTabBar>
#include <QFrame>

#include <ElaTabWidget.h>
#include <ElaComboBox.h>
#include <ElaText.h>
#include <ElaLineEdit.h>
#include <ElaPushButton.h>
#include <ElaMessageBar.h>

#include <shlib/quc_sdk/customwidget/uicustomdialog.h>

#include <shlib/cwebrequestapi.h>
#include "cmodbusmapinfo.h"
#include "uimodbusbase.h"

class UiModBusMapInfo : public QWidget
{
    Q_OBJECT
public:
    explicit UiModBusMapInfo(QWidget *parent = nullptr);

signals:
    void selectMapChange(const QString& userid, const QString& modelName, const QString& mapid);

public slots:
    void slotSelectModelChange(const QString& name, const QString& user);

    void slotMapChange(int index);

    void slotAddMap();


private:
    ElaTabWidget* m_tabwidget;
    ElaComboBox* m_cbxmaps;
    ElaPushButton* m_btnadd;

    UiModbusBase* m_yxview;
    UiModbusBase* m_ykview;
    UiModbusBase* m_ycview;
    UiModbusBase* m_parameterview;

    QList<CModbusMapInfo> m_maps;

    QString m_curmap;

    QString m_user;
    QString m_modelName;
};

#endif // UIMODBUSMAPINFO_H
